<?php
	session_start();
	$dir = "../users/".$_SESSION['username'];
	$files = scandir($dir);
	$id = 0;
	$nodes = array();
	foreach($files as $file)
	{
		if($file == '.' || $file == '..' || $file == '.svn') continue;
		$item['id'] = $id + 1;
		$item['leaf'] = true;
		$item['text'] = $file;
		$item['cls'] = 'folder';
		$nodes[$id++] = $item;
	}
	echo json_encode($nodes);
?>
